package day03;

public class OperDemo3 {
    public static void main(String[] args) {
        //逻辑运算符:(短路 与)&&与, (短路 或)||或, !非
        //逻辑运算符:(短路 与)&&与, (短路 或)||或, !非
        int a = 5, b = 10, c = 5;
        boolean b1 = b >= a && b < c;
        System.out.println(b1);
        System.out.println(b <= c && b > a);
        System.out.println(a == b && c > b);
        System.out.println(b != c && a > b);

        int age = 40;
        System.out.println(age >= 18 && age <= 50);
        int score = 86;
        System.out.println(score >= 0 && score <= 100);

        int x = 5, y = 10, z = 5;
        System.out.println(y >= x || y < z);
        System.out.println(y >= z || y > x);
        System.out.println(y != z || x < y);
        System.out.println(x == y || y < z);

        int score2 = 90;
        System.out.println(score2 >= 0 || score2 > 100);

        boolean b2 = !(x < y);
        System.out.println(b2);
        System.out.println(!(x > y));

        //短路与
        boolean b3 = x > y && z++ > 2;
        System.out.println(b3);
        System.out.println(z);
        System.out.println("——————————————————————————————");
        //短路或
        boolean b4 = x < y || z++ > 2;
        System.out.println(b4);
        System.out.println(z);

    }
}
